Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    color: "#B6B3B3",
    selectedColor: "#46414D",
    list: [
      {
        pagePath: "/pages/index/index",
        text: "主页",
        selectedIconPath: "/images/tabs/tab-homeIconSelected.png",
        iconPath: "/images/tabs/tab-homeIcon.png"
      },
      {
        pagePath: "/pages/user/index/user",
        text: "我的",
        selectedIconPath: "/images/tabs/tab-userIconSelected.png",
        iconPath: "/images/tabs/tab-userIcon.png"
      }
    ],
  },
  lifetimes: {
    attached() {

    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({ url })
      this.setData({
        selected: data.index
      })
      console.log(this.data.selected,"selected")
    }
  }
})
